home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / library / amymetfl.lha / AmigaMetaFileFormat / AmigaMetaFormat.doc < prev    next >
Text File  |  1996-04-16  |  5KB  |  147 lines

  1. TABLE OF CONTENTS
  2.  
  3. amigametaformat.library/--background--
  4. amigametaformat.library/AmfOpen
  5. amigametaformat.library/AmfFunction
  6. amigametaformat.library/AmfClose
  7. amigametaformat.library/--background--        amigametaformat.library/--background--
  8.  
  9.   PURPOSE
  10.       The amigametaformat.library let you draw in a virtual space AND
  11.       map this TO any outputdevice, like window, rastport, metafile etc.
  12.  
  13. amigametaformat.library/AmfOpen               amigametaformat.library/AmfOpen
  14.  
  15.   NAME
  16.       AmfOpen - create a amf structure
  17.  
  18.   SYNOPSIS
  19.       amf = AmfOpen(channel,dataArray);
  20.        D0             A0      D0
  21.  
  22.        APTR *AmfOpen(ULONG, ULONG**);
  23.  
  24.   FUNCTION
  25.        This routine allocs memory for the amf structure.
  26.        This routine must be called as the first.
  27.  
  28.   INPUTS
  29.        channel -- outputchannel
  30.                   ( 1-window, 3-IFF, 4-rastport, 5-EPS, 6-GEM, 7-CGM)
  31.        dataArray -- array that include the datas for the channel
  32.                     ( CASE channel=window
  33.                         [Window    struct window *,
  34.                          cm        struct colormap *]
  35.                       CASE channel=IFF
  36.                         [iff       struct IFFHandle *,
  37.                          xsize     ULONG,
  38.                          ysize     ULONG]
  39.                       CASE channel=rastport
  40.                         [RPort     struct RastPort *,
  41.                          xstart    ULONG,
  42.                          ystart    ULONG,
  43.                          xsize     ULONG,
  44.                          ysize     ULONG]
  45.                       CASE channel=EPS
  46.                         [File      filehandle *]
  47.                       CASE channel=GEM
  48.                         [File      filehandle *]
  49.                       CASE channel=CGM
  50.                         [File      filehandle *]
  51.                     )
  52.  
  53.       - The Window must be opened and the colormap must be valid, example
  54.         screen.viewport.colormap.
  55.         This channel let you draw to a window.
  56.       - The IFFHandle must be initialized, filled with iff_Stream,
  57.         and opened.
  58.         
  59.         if file=open(...)
  60.           {
  61.             if iff=allociff()
  62.               {
  63.                 initiffasdos(iff);
  64.                 iff.stream=file;
  65.                 openiff(iff,ifff_write);
  66.                 if amf=amfopen(3,...)
  67.                 ...
  68.                 freeiff(iff)
  69.               }
  70.             close(file)
  71.           }
  72.         
  73.         xsize and ysize the original size (p.e. 640x400)
  74.         This channel let you save the draw within a IFF-structure. The
  75.         structure have just 2 ID's:
  76.         VERS: 2 ULONGs that store the Library-version with
  77.               first ULONG:  version  (ex: 1)
  78.               second ULONG  revision (ex: 0)
  79.         BODY: all functions (except Get... and SetDPI and SetFont to Font)
  80.               are stored in this
  81.               way:
  82.                   BEGIN
  83.                     function-number             ULONG
  84.                     count                       ULONG
  85.                     first data from dataArray   ULONG
  86.                     second data                 ULONG
  87.                     ....
  88.                     (count) data                ULONG
  89.                   END
  90.                   repeated for every called function
  91.       - The RastPort must have a valid bitmap-structure.
  92.  
  93.   RESULT
  94.        amf -- an initialized amf structure, or NULL on failure
  95.  
  96.   NOTES
  97.        The amf structure are private only!
  98.  
  99.   BUGS
  100.        Some channels are still in progress.
  101.  
  102.   FUTURE
  103.  
  104. amigametaformat.library/AmfFunction       amigametaformat.library/AmfFunction
  105.  
  106.    NAME
  107.         AmfFunction -- select a amf Function
  108.  
  109.    SYNOPSIS
  110.         result = AmfFunction(amf,dataArray,function,count);
  111.           D0                  A1    A0       D1      D0
  112.  
  113.         ULONG  *AmfFunction(APTR, ULONG**, ULONG, ULONG);
  114.  
  115.    FUNCTION
  116.         Select a function from the amf functions and draw the result to
  117.         the opened channel or get the result back.
  118.  
  119.    INPUTS
  120.         amf -- amf struct ready opened with AmfOpen()
  121.         dataArray -- array of ULONG with the needed datas
  122.         function -- amf function defined in amigametafile.const
  123.         count -- counter of ULONGs in dataArray
  124.  
  125.    RESULT
  126.         NULL   for all draw and set functions, if there was no error
  127.         <>NULL for all draw and set functions, if not supported
  128.         RESULT for all get functions
  129.    
  130.    NOTES
  131.         Some functions on some channels are not supported.
  132.  
  133. amigametaformat.library/AmfClose             amigametaformat.library/AmfClose
  134.  
  135.    NAME
  136.         AmfClose -- free amf struct
  137.  
  138.    SYNOPSIS
  139.         AmfClose(amf);
  140.                   D0
  141.  
  142.         VOID AmfClose(APTR)
  143.  
  144.    FUNCTION
  145.         Free all memory allocated for amf structure.
  146.  
  147.